package org.fangzz.cameramgr.cameramonitor.rest;


import org.fangzz.cameramgr.cameramonitor.dto.AreaSummary;
import org.fangzz.cameramgr.cameramonitor.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
public class AreaRestController {

    @Autowired
    private AreaService areaService;

    @GetMapping("/api/area/{provinceCode}")
    public @ResponseBody
    Map<String,List<AreaSummary>> getAreaOfProvince(@PathVariable String provinceCode){
        return areaService.findByProvinceCode(provinceCode);
    }


}
